﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>

    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>Olala电子购物系统</title>
</head>
<body>
<input type="hidden" class="input-text" value="" id="userId" name="userId">
<input type="hidden" class="input-text" value="" id="roleName" name="roleName">
<input type="hidden" class="input-text" value="" id="userName" name="userName">
<input type="hidden" class="input-text" value="" id="realName" name="realName">
<input type="hidden" class="input-text" value="" id="mobile" name="mobile">
<input type="hidden" class="input-text" value="" id="email" name="email">
<input type="hidden" class="input-text" value="" id="registerTime" name="registerTime">
<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container-fluid cl"><a class="logo navbar-logo f-l mr-10 hidden-xs" href="../../aboutHui.shtml">Olala后台管理系统</a>
            <a class="logo navbar-logo-m f-l mr-10 visible-xs" href="/aboutHui.shtml">Olala后台管理系统</a>
            <span class="logo navbar-slogan f-l mr-10 hidden-xs">v1.0</span>
            <a aria-hidden="false" class="nav-toggle Hui-iconfont visible-xs" href="javascript:;">&#xe667;</a>
            <nav class="nav navbar-nav">
                <ul class="cl">
                    <li class="dropDown dropDown_hover"><a href="javascript:;" class="dropDown_A"><i
                            class="Hui-iconfont">&#xe600;</i> 新增 <i class="Hui-iconfont">&#xe6d5;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" onclick="article_add('添加资讯','article-add.html')"><i
                                    class="Hui-iconfont">&#xe616;</i> 资讯</a></li>
                            <li><a href="javascript:;" onclick="picture_add('添加资讯','picture-add.html')"><i
                                    class="Hui-iconfont">&#xe613;</i> 图片</a></li>
                            <li><a href="javascript:;" onclick="product_add('添加资讯','product-add.html')"><i
                                    class="Hui-iconfont">&#xe620;</i> 产品</a></li>
                            <li><a href="javascript:;" onclick="member_add('添加用户','member-add.html','','510')"><i
                                    class="Hui-iconfont">&#xe60d;</i> 用户</a></li>
                        </ul>
                    </li>
                </ul>
            </nav>
            <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                <ul class="cl">
                    <li id="adminRole"></li>
                    <li class="dropDown dropDown_hover">
                        <a href="#" id="adminUser" class="dropDown_A"></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" onClick="mySelfInfo()">个人信息</a></li>
                            <li><a href="javascript:changeUser();">切换账户</a></li>
                            <li><a href="javascript:loginOut();">退出</a></li>
                        </ul>
                    </li>
                    <li id="Hui-msg"><a href="#" title="消息"><span class="badge badge-danger">1</span><i
                            class="Hui-iconfont" style="font-size:18px">&#xe68a;</i></a></li>
                    <li id="Hui-skin" class="dropDown right dropDown_hover"><a href="javascript:;" class="dropDown_A"
                                                                               title="换肤"><i class="Hui-iconfont"
                                                                                             style="font-size:18px">&#xe62a;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li><a href="javascript:;" data-val="default" title="默认（黑色）">默认（黑色）</a></li>
                            <li><a href="javascript:;" data-val="blue" title="蓝色">蓝色</a></li>
                            <li><a href="javascript:;" data-val="green" title="绿色">绿色</a></li>
                            <li><a href="javascript:;" data-val="red" title="红色">红色</a></li>
                            <li><a href="javascript:;" data-val="yellow" title="黄色">黄色</a></li>
                            <li><a href="javascript:;" data-val="orange" title="橙色">橙色</a></li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>
<aside class="Hui-aside" id="menu-aside">
</aside>
<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a>
</div>
<section class="Hui-article-box">
    <div id="Hui-tabNav" class="Hui-tabNav hidden-xs">
        <div class="Hui-tabNav-wp">
            <ul id="min_title_list" class="acrossTab cl">
                <li class="active">
                    <span title="我的桌面" data-href="welcome.html">我的桌面</span>
                    <em></em></li>
            </ul>
        </div>
        <div class="Hui-tabNav-more btn-group"><a id="js-tabNav-prev" class="btn radius btn-default size-S"
                                                  href="javascript:;"><i class="Hui-iconfont">&#xe6d4;</i></a><a
                id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:;"><i class="Hui-iconfont">&#xe6d7;</i></a>
        </div>
    </div>
    <div id="iframe_box" class="Hui-article">
        <div class="show_iframe">
            <div style="display:none" class="loading"></div>
            <iframe scrolling="yes" frameborder="0" src="welcome.html"></iframe>
        </div>
    </div>
</section>

<div class="contextMenu" id="Hui-admin-menu">
    <ul>
        <li id="closeThis">关闭当前</li>
        <li id="closeAll">关闭全部</li>
    </ul>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        initMenuForNav();
        buildAdminInfo();
        initAdminInfo();

        $("#min_title_list li").contextMenu('Hui-admin-menu', {
            bindings: {
                'closeThis': function(t) {
                    if(t.find("i")){
                        t.find("i").trigger("click");
                    }
                },
                'closeAll': function(t) {
                    alert('Trigger was '+t.id+'\nAction was Email');
                },
            }
        });
    })

    function initAdminInfo(){
        var userName = $("#userName").val();
        var roleName = $("#roleName").val();
        $("#adminRole").html(roleName);
        $("#adminUser").html(userName+" <i class=\"Hui-iconfont\">&#xe6d5;</i>");
    }

    //初始化首页账号信息
    function buildAdminInfo() {
        $.ajax({
            type: 'post',
            url: '../sysAccountApi/queryIndexPersonInfo.do',
            async:false,
            data:{
                params: {}
            },
            success:function(data){
                if(data.respData.respCode == 10000){
                    var accountInfo = data.respData.result;
                    $("#userId").val(accountInfo.userId);
                    $("#roleName").val(accountInfo.roleName);
                    $("#userName").val(accountInfo.userName);
                    $("#realName").val(accountInfo.realName);
                    $("#mobile").val(accountInfo.mobile);
                    $("#email").val(accountInfo.email);
                    $("#registerTime").val(accountInfo.updateTime);
                }else{
                    layer.msg('未查询到数据!',{icon: 6,time:2000});
                    return ;
                }
            },
            error:function(data){
                layer.msg('服务异常，请联系管理员处理!',{icon: 6,time:3000});
            }
        });
        return;
    }

    //初始化导航栏菜单视图
    function initMenuForNav(){
        $("#menu-aside").html("");
        var $menu_drop = $("<div class=\"menu_dropdown bk_2\"></div>");
        $.ajax({
            type: 'POST',
            url: '../sysAccountApi/initMenuForIndex.do',
            dataType: 'json',
            async:false,
            data:{
                params: {}
            },
            success: function(data){
                if(data.respData.respCode == 10000){
                    var menuVoList = data.respData.result;
                    if(menuVoList != null && menuVoList.length > 0){
                        $.each(menuVoList,function (index,menuObj) {
                            var iconArr = new Array(2);
                            if(menuObj.icon != null && menuObj.icon.length > 0){
                                iconArr = menuObj.icon.split(',');
                            }
                            var $menuDL = $("<dl id=\""+iconArr[0]+"\"></dl>");
                            var $titleDT = $("<dt><i class=\"Hui-iconfont\">"+iconArr[1]+"</i> "+menuObj.menuName+"<i class=\"Hui-iconfont menu_dropdown-arrow\">&#xe6d5;</i></dt>");
                            $menuDL.append($titleDT);
                            var $childMenuDD = $("<dd></dd>");
                            var $childMenuUL = $("<ul></ul>");
                            $.each(menuObj.childList,function (n,childMenuObj) {
                                $childMenuUL.append("<li><a data-href=\""+childMenuObj.url+"\" data-title=\""+childMenuObj.menuName+"\" href=\"javascript:void(0)\">"+childMenuObj.menuName+"</a></li>");
                            });
                            $childMenuDD.append($childMenuUL);
                            $menuDL.append($childMenuDD);
                            $menu_drop.append($menuDL);
                        });
                    }
                } else {
                    layer.msg('未查询菜单权限，请联系管理员授权！',{icon: 6,time:3000});
                }
                $("#menu-aside").append($menu_drop);
            },
            error:function(data) {
                console.log(data.msg);
            },
        });
    }

</script>
<script type="text/javascript" src="lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<!--此乃百度统计代码，请自行删除-->
<script>
    // var _hmt = _hmt || [];
    // $(function () {
    //     var hm = document.createElement("script");
    //     hm.src = "https://hm.baidu.com/hm.js?080836300300be57b7f34f4b3e97d911";
    //     var s = document.getElementsByTagName("script")[0];
    //     s.parentNode.insertBefore(hm, s);
    //
    // });

    /*个人信息*/
    function mySelfInfo() {
        var userName = $("#userName").val();
        var roleName = $("#roleName").val();
        var realName = $("#realName").val();
        var mobile = $("#mobile").val();
        var email = $("#email").val();
        var registerTime = $("#registerTime").val();

        var $div = $("<div class=\"pd-20\"></div>");
        var $table = $("<table class=\"table\"></table>");
        var $tbody = $("<tbody></tbody>");
        var $tr0 = $("<tr><th class=\"text-r\" width=\"80\">角色：</th><td id=\"roleName\">"+roleName+"</td></tr>");
        var $tr1 = $("<tr><th class=\"text-r\" width=\"80\">账号：</th><td id=\"userName\">"+userName+"</td></tr>");
        var $tr2 = $("<tr><th class=\"text-r\" width=\"80\">真实姓名：</th><td id=\"roleName\">"+realName+"</td></tr>");
        var $tr3 = $("<tr><th class=\"text-r\" width=\"80\">手机号：</th><td id=\"mobile\">"+mobile+"</td></tr>");
        var $tr4 = $("<tr><th class=\"text-r\" width=\"80\">注册时间：</th><td id=\"registerTime\">"+registerTime+"</td></tr>");
        $tbody.append($tr0).append($tr1).append($tr2).append($tr3).append($tr4);
        $table.append($tbody);
        $div.append($table);
        var content = '<div>管理员信息</div>'+$div.html();
        layer.open({
            type: 1,
            area: ['300px', '200px'],
            fix: false, //不固定
            maxmin: true,
            shade: 0.4,
            title: '查看信息',
            content: content
        });
    }

    /*资讯-添加*/
    function article_add(title, url) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }

    /*图片-添加*/
    function picture_add(title, url) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }

    /*商品-添加*/
    function product_add(title, url) {
        var index = layer.open({
            type: 2,
            title: title,
            content: url
        });
        layer.full(index);
    }

    /*用户-添加*/
    function member_add(title, url, w, h) {
        layer_show(title, url, w, h);
    }

    //退出登录
    function loginOut() {
        layer.confirm('确认要退出吗？',function(index){
            $.ajax({
                type: 'POST',
                url: '../sysAccountApi/loginOut.do',
                dataType: 'json',
                data:{
                    params: {}
                },
                success: function(data){
                    window.location.href = "../backstage/login.html"
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }

    //切换账号
    function changeUser() {
        layer.confirm('确认要切换至其他账号吗？',function(index){
            $.ajax({
                type: 'POST',
                url: '../sysAccountApi/changeUser.do',
                dataType: 'json',
                data:{
                    params: {}
                },
                success: function(data){
                    var userInfo = data.respData.result;
                    window.location.href = "../backstage/login.html?userName="+escape(userInfo.userName);
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }
</script>
<!--/此乃百度统计代码，请自行删除-->
</body>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
</html>